package com.piggy.logi.sys.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 结清状态举
 */
@Getter
@AllArgsConstructor
public enum SettleStatusEnum {

    NOT_SETTLE(0, "未结清"),

    SETTLED(1, "已结清"),

    STATUS_UNKNOWN(-1, "未知状态"),

    ;

    private final int code;

    private final String info;

    public static SettleStatusEnum get(int code) {
        return Arrays.stream(values()).filter(t-> t.getCode()== code).findFirst().orElse(STATUS_UNKNOWN);
    }
}
